package com.lionxing.DNTG;

import org.cocos2d.actions.CCTimer;
import org.cocos2d.layers.CCLayer;
import org.cocos2d.layers.CCScene;
import org.cocos2d.nodes.CCDirector;
import org.cocos2d.nodes.CCSprite;
import org.cocos2d.types.CGPoint;
import org.cocos2d.types.CGSize;

public class spLayer extends CCLayer {
	
	public static CCScene scene() {
		CCScene scene = CCScene.node();
		spLayer layer = new spLayer();
		scene.addChild(layer);
		
		return scene;
	}
	
	protected spLayer()
	{
		playSound.sharedDirector().playbgSound(R.raw.bg, true);
		
		CGSize size = CCDirector.sharedDirector().winSize();
		
		CCSprite bgSp = CCSprite.sprite("Default.png");
		
		
		
		bgSp.setScaleX((size.width/GameDefine.KIos_W));
		bgSp.setScaleY((size.height/GameDefine.KIos_h));
		bgSp.setPosition(CGPoint.make(size.width/2, size.height/2));
		//Log.
		addChild(bgSp, -1);
		
		
		schedule("autoremove", 2.5f);
		
	}
	
	public void autoremove(float per)
	{
		
		unschedule("autoremove");
		
		CCScene scene = MainLayer.scene();
		// CCDirector.sharedDirector().replaceScene(scene);
		 scenemanager.go(scene);
	}
	
	 public  void onExit()
		{		
				this.removeAllChildren(true);
				super.onExit();
		}

}
